<?php

namespace app\admin\validate;

use W7\Validate\Validate;

class SystemConfig extends Validate
{
    protected $rule =   [
        'cid'                       => 'required',
        'title'                     => 'required',
        'name'                      => 'required',
        'component'                 => 'required',
        'placeholder'               => 'required',
    ];

    protected $message  =   [
        'cid.required'              => '异常错误，缺少分类ID',
        'title.required'            => '请输入配置项名称',
        'name.required'             => '请输入配置项标识',
        'component.required'        => '请选择表单类型',
        'placeholder.required'      => '请输入配置项描述',
    ];

    protected $scene = [
        'add'               =>  ['title', 'name', 'type', 'placeholder'],
        'edit'              =>  ['title', 'type', 'placeholder'],
    ];
}
